package com.intelligent.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 采购需求信息表
 * @TableName purchase_demand
 */
@TableName(value ="purchase_demand")
@Data
public class PurchaseDemand implements Serializable {
    /**
     * 自增主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 采购需求单号
     */
    private String demandNo;

    /**
     * 采购状态（0 待采购入库、1 部分采购入库、2 全部采购入库）
     */
    private Integer purchaseStatus;

    /**
     * 生产计划
     */
    private Long productionPlanId;

    /**
     * 生产产品
     */
    private Long productId;

    /**
     * 所需物料
     */
    private Long productionId;

    /**
     * 备注（截图中“分岁”字段可能是“备注”或其他业务字段，可根据实际调整）
     */
    private String remark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PurchaseDemand other = (PurchaseDemand) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDemandNo() == null ? other.getDemandNo() == null : this.getDemandNo().equals(other.getDemandNo()))
            && (this.getPurchaseStatus() == null ? other.getPurchaseStatus() == null : this.getPurchaseStatus().equals(other.getPurchaseStatus()))
            && (this.getProductionPlanId() == null ? other.getProductionPlanId() == null : this.getProductionPlanId().equals(other.getProductionPlanId()))
            && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
            && (this.getProductionId() == null ? other.getProductionId() == null : this.getProductionId().equals(other.getProductionId()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDemandNo() == null) ? 0 : getDemandNo().hashCode());
        result = prime * result + ((getPurchaseStatus() == null) ? 0 : getPurchaseStatus().hashCode());
        result = prime * result + ((getProductionPlanId() == null) ? 0 : getProductionPlanId().hashCode());
        result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
        result = prime * result + ((getProductionId() == null) ? 0 : getProductionId().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", demandNo=").append(demandNo);
        sb.append(", purchaseStatus=").append(purchaseStatus);
        sb.append(", productionPlanId=").append(productionPlanId);
        sb.append(", productId=").append(productId);
        sb.append(", productionId=").append(productionId);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}